<template>
	<div class="allcontainer bg-white" style="position: relative;">
		<div class="h2" style="margin-top: 10px;">发起活动</div>
		<div class="main no-frame">
			<a-form :form="form" :label-col="{ span: 8 }" :wrapper-col="{ span: 18 }" @submit="handleSubmit">
				<a-form-item label="学生组织/班级">
					<a-select :allowClear="true"
						v-decorator="['ValueID', { rules: [{ required: true, message: '请选择学生组织/班级' }] }]"
						placeholder="请选择学生组织/班级" optionFilterProp="children" showSearch @change="ClubAndClassFun">
						<a-select-option v-for="(item, index) in ClubAndClassList" :key="index"
							:value="item.ID + '|' + item.Type">{{ item.Value }} - {{ item.Type=='Club'?'学生组织':'班级' }}
						</a-select-option>
					</a-select>
				</a-form-item>
				<a-form-item label="活动类型">
					<a-tree-select :disabled="treeselect" :allowClear="true" show-search
						v-decorator="['oldActivityTypeApplyID', { rules: [{ required: true, message: '请选择活动类型' }] }]"
						:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :tree-data="ActivityTypeApplyList"
						tree-default-expand-all :replace-fields="replaceFields" placeholder="请先选择学生组织/班级"
						@change="ActivityTypeApplyFun"></a-tree-select>
				</a-form-item>
				<a-form-item label="活动标题" v-show="itemDataShow">
					<a-select :allowClear="true"
						v-decorator="['TypeItemID', { rules: [{ required: itemDataShow?true:false, message: '请选择活动标题' }] }]"
						placeholder="请选择活动标题" optionFilterProp="children" showSearch>
						<a-select-option v-for="(item, index) in itemData" :key="item.ID" :value="item.ID"
							:disabled="!item.IsEnable">{{ item.Name }}</a-select-option>
					</a-select>
				</a-form-item>
				<a-form-item label="活动标题" v-show="!itemDataShow">
					<a-input placeholder="请选择活动标题"
						v-decorator="['Title', { rules: [{ required: !itemDataShow?true:false, message: '活动标题不能为空' }] }]" />
				</a-form-item>
				<a-form-item label="选择班级学生" v-show="!clubShow" class="label1">
					<div style="color:#f00;">未参加活动的同学，请将其姓名前面的“√”号勾除即可；班级参与人员修改请在“成员管理”模块操作。</div>
					<a-checkbox-group
						v-decorator="['MemberUserNoArr', { rules: [{ required: !clubShow?true:false, message: '请选择班级学生' }],initialValue:MemberUserNoArr }]">
						<a-checkbox v-for="(item,i) in MemberUserNoList" :key="item.UserNo" :value="item.UserNo">
							{{ item.UserNo }} - {{ item.Name }}</a-checkbox>
					</a-checkbox-group>
				</a-form-item>
				<a-form-item label="活动时长（h）" v-if="IsHour">
					<a-input type="number"
						v-decorator="['HourNum', { rules: [{ required: true, message: '请输入活动时间' }, { validator: intValidator }] }]" />
				</a-form-item>
				<a-form-item label="是否需要报名" v-show="clubShow">
					<a-radio-group @change="IsNeedApplyChange"
						v-decorator="['IsNeedApply', { rules: [{ required: clubShow?true:false, message: '请选择是否需要报名' }],initialValue:false }]">
						<a-radio :value="true">是</a-radio>
						<a-radio :value="false">否</a-radio>
					</a-radio-group>
					<oprateBtn class="tishi" icon="icon-wenhao" color="green"
						title="如是，参加活动必须先报名，然后签到；如为否，不需要提前报名加入，活动现场扫码即可"></oprateBtn>
				</a-form-item>
				<!-- <a-form-item label="是否需要置顶" v-show="clubShow">
					<a-radio-group  v-decorator="['IsTop', { rules: [{ required: clubShow?true:false, message: '请选择是否需要置顶' }],initialValue:false }]">
						<a-radio :value="true">是</a-radio>
						<a-radio :value="false">否</a-radio>
					</a-radio-group>
				</a-form-item> -->
				<a-form-item label="诚信值" v-show="isHonestyScore">
					<a-input-number :min="0" :max="100" style="width: 100%;" placeholder="请输入诚信值"
						v-decorator="['HonestyScore', { rules: [{ required: isHonestyScore?true:false, message: '请输入诚信值' }, { validator: intValidator }] }]" />
				</a-form-item>
				<a-form-item label="是否需要提交作业" v-show="clubShow">
					<a-radio-group
						v-decorator="['IsNeedActivityJob', { rules: [{ required: clubShow?true:false, message: '请选择是否需要提交作业' }],initialValue:false }]">
						<a-radio :value="true">是</a-radio>
						<a-radio :value="false">否</a-radio>
					</a-radio-group>
				</a-form-item>
				<a-form-item label="报名时间" v-show="form.getFieldValue('IsNeedApply') && clubShow">
					<a-range-picker show-time
						v-decorator="['ApplyTime', { rules: [{ required: form.getFieldValue('IsNeedApply') && clubShow?true:false, message: '报名时间不能为空' }] }]" />
				</a-form-item>
				<a-form-item label="场地管理" v-if="clubShow">
					<a-input @click="venueReserveDataFun" placeholder="请选择场地" v-decorator="['venueReserveData']" />
					<div v-for="(item,i) in venueList" class="flex venueli">
						<div>{{ item.VenueName }} -- {{ item.Date }} -- {{ item.VenueTimeTable }}</div><i
							@click="deleteVenue(i)" class="el-icon-circle-close"></i>
					</div>
				</a-form-item>
				<a-form-item label="参加活动是否需要审批" v-show="form.getFieldValue('IsNeedApply') && clubShow">
					<a-radio-group
						v-decorator="['ApplyIsNeedExam', { rules: [{ required: clubShow?true:false, message: '请选择参加活动是否需要审批' }],initialValue:false }]">
						<a-radio :value="true">是</a-radio>
						<a-radio :value="false">否</a-radio>
					</a-radio-group>
					<oprateBtn class="tishi" icon="icon-wenhao" color="green"
						title="如是，申请加入活动人员必须审批通过才可加入；如为否，申请加入活动人员申请后无需审批直接加入"></oprateBtn>
				</a-form-item>
				<a-form-item label="是否设置奖项" v-show="clubShow">
					<a-radio-group
						v-decorator="['IsHasPrize', { rules: [{ required: clubShow?true:false, message: '请选择是否设置奖项' }] }]">
						<a-radio :value="true">是</a-radio>
						<a-radio :value="false">否</a-radio>
					</a-radio-group>
					<oprateBtn class="tishi" icon="icon-wenhao" color="green" title="如果选择设置奖项，则需在申请完结之前添加奖项，否则无法提交完结申请">
					</oprateBtn>
				</a-form-item>
				<a-form-item label="活动时间">
					<a-range-picker show-time
						v-decorator="['activityDate', { rules: [{ required: true, message: '活动时间不能为空' }] }]" />
				</a-form-item>
				<a-form-item label="活动人数" v-show="clubShow">
					<a-select :allowClear="true" placeholder="全部" optionFilterProp="children" showSearch
						style="width:100px;margin-right:20px;" @change="PeopleNumFun" v-model="PeopleNumIf">
						<a-select-option v-for="(item, index) in PeopleNumList" :key="index" :value="item.Key">
							{{ item.Value }}</a-select-option>
					</a-select>
					<a-input placeholder="请输入活动人数" style="width:200px;" v-show="PeopleNumIf == 1" type="number"
						v-decorator="['PeopleNum', { rules: [{ required: true, message: '活动人数不能为空' }, { validator: allintValidator }] }]" />
				</a-form-item>
				<a-form-item v-for="item in data" :label="item.Name">
					<a-input v-if="item.FieldType == 1" v-decorator="[
							item.ID,
							{
								rules: [{ required: item.IsMust, message: item.ErroeMsg ? item.ErroeMsg : item.Name + '不能为空' }, { validator: rules[item.ID] ? rules[item.ID].validator : '' }]
							}
						]" />
					<a-input v-if="item.FieldType == 2" type="textarea" :auto-size="global.textareaHeight" v-decorator="[
							item.ID,
							{
								rules: [{ required: item.IsMust, message: item.ErroeMsg ? item.ErroeMsg : item.Name + '不能为空' }, { validator: rules[item.ID] ? rules[item.ID].validator : '' }]
							}
						]" />
					<a-input v-if="item.FieldType == 3" type="number" v-decorator="[
							item.ID,
							{
								rules: [
									{ required: item.IsMust, message: item.ErroeMsg ? item.ErroeMsg : item.Name + '不能为空' },
									{ validator: rules[item.ID] ? rules[item.ID].validator : intValidator }
								]
							}
						]" />
					<a-input v-if="item.FieldType == 4" type="number" :step="0.01" v-decorator="[
							item.ID,
							{
								rules: [{ required: item.IsMust, message: item.ErroeMsg ? item.ErroeMsg : item.Name + '不能为空' }, { validator: rules[item.ID] ? rules[item.ID].validator : '' }]
							}
						]" />

					<a-upload v-if="item.FieldType == 5 || item.FieldType == 6"
						v-decorator="[item.ID, { rules: [{ required: item.IsMust, message: item.ErroeMsg ? item.ErroeMsg : item.Name + '不能为空' }] }]"
						:accept="item.FieldType == 5 ? '' : 'image/*'" :multiple="true" list-type="picture-card"
						:action="requestUrl+'/Common/DoUploadFile?type='+(item.FieldType == 5?'file':'image')"
						:file-list="fileList[item.ID]" @preview="handlePreview"
						:before-upload="e => beforeUploadfile(e,item.ID)" @change="e => handleChange(e, item.ID)">
						<div class="upload-btn" v-if="fileList[item.ID].length < 8">
							<span>↥</span>
							<div class="ant-upload-text">上传{{item.Name}}</div>
						</div>
					</a-upload>
					<a-date-picker v-if="item.FieldType == 7" @change="e => dataChange(e, item.ID, 'data')"
						v-decorator="[item.ID, { rules: [{ required: item.IsMust, message: item.ErroeMsg ? item.ErroeMsg : item.Name + '不能为空' }] }]" />
					<a-time-picker v-if="item.FieldType == 8" @change="e => dataChange(e, item.ID, 'time')"
						v-decorator="[item.ID, { rules: [{ required: item.IsMust, message: item.ErroeMsg ? item.ErroeMsg : item.Name + '不能为空' }] }]" />
				</a-form-item>

				<a-form-item class="fixed-bottom" style="text-align: right;">
					<a-popconfirm title="暂存后不会提交,在列表页点击提交按钮提交!" ok-text="好的" cancel-text="取消" @confirm="confirm"
						@cancel="cancel">
						<a-button type="primary" html-type="submit">暂存</a-button>
					</a-popconfirm>
					<a-button style="margin-left: 10px;padding: 0 32px;" @click="$router.back(-1)">取消</a-button>
				</a-form-item>
			</a-form>
		</div>
		<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel"><img alt="example" style="width: 100%"
				:src="previewImage" /></a-modal>
		<venue class="venue" @closevenue="closevenue" v-if="venueIf"></venue>
	</div>
</template>

<script>
	import moment from 'moment';
	import Func from '@/utils/func';
	import venue from '@/components/venue.vue';
	import {
		GetApplyClubAndClass,
		GetFormList,
		userAddActivity,
		UserUpdateActivity,
		UserDoGetActivityTypeList,
		UserGetApplyTypeActivity,
		UserClassStudentDoGetPageList
	} from '@/api/follow';
	const data = [];
	export default {
		components: {
			venue
		},
		props: {
			text: Object,
		},
		watch: {
			time: {
				handler(text) {},
				immediate: true
			}
		},
		data() {
			return {
				isHonestyScore: true,
				icofileList: [],
				fileList: {},
				previewVisible: false,
				previewImage: '',
				fileList1: [],
				previewVisible1: false,
				previewImage1: '',
				data,
				formLayout: 'horizontal',
				form: this.$form.createForm(this, {
					name: 'coordinated'
				}),
				showstate: true,
				formValue: {},
				dataValue: {},
				rules: {},
				ActivityTypeList: [],
				requestUrl: this.global.requestUrl,
				ClubAndClassList: [],
				OldActivityTypeApplyList: [],
				ActivityTypeApplyList: [],
				IsHour: false,
				PeopleNumList: this.global.PeopleNumList,
				PeopleNumIf: 2,
				replaceFields: {
					children: 'children',
					title: 'title',
					key: 'ID',
					// value: 'ActivityTypeID'
					value: 'ID'
				},
				ActivityTypeApplyID: '',
				treeselect: true,
				MemberUserNoList: [],
				MemberUserNoArr: [],
				itemData: [],
				pubActivityTypeID: '',
				itemDataShow: false,
				clubShow: true,
				venueIf: false,
				venueList: [],
			};
		},
		computed: {},
		created() {
			this.getClubAndClassList();
			// this.getList();
		},
		mounted() {
			this.$nextTick(() => {
				this.form.setFieldsValue({
					PeopleNum: -1
				});
			})
		},
		methods: {
			deleteVenue(i) {
				this.venueList.splice(i, 1)
			},
			closevenue(data) {
				this.venueIf = false
				if (data.length > 0) {
					let obj = {}
					let productArr = data.reduce((cur, next) => {
						obj[next.TimeTableID] ? '' : (obj[next.TimeTableID] = true && cur.push(next))
						return cur
					}, []) // 设置cur默认类型为数组，并且初始值为空的数组

					this.venueList = this.venueList.concat(productArr)

					const res = new Map();
					this.venueList = this.venueList.filter((item) => !res.has(item['VenueTimeTableID']) && res.set(item[
						'VenueTimeTableID'], 1));
					console.log(this.venueList)
				}

			},

			venueReserveDataFun() {
				this.venueIf = true
			},
			moment,
			allintValidator(rule, value, callback) {
				let pattern = /(^-?[1-9]\d*$)/;
				if (value && !pattern.test(value)) {
					callback('请输入整数');
				} else {
					callback();
				}
				callback();
			},
			intValidator(rule, value, callback) {
				let pattern = /(^[1-9]\d*$)/;
				if (value && !pattern.test(value)) {
					callback('请输入正整数');
				} else {
					callback();
				}
				callback();
			},
			async getClubAndClassList() {
				let res = await GetApplyClubAndClass();
				this.ClubAndClassList = res.data.data
			},
			async ClubAndClassFun(e) {
				this.form.setFieldsValue({
					oldActivityTypeApplyID: '',
					TypeItemID: ''
				});
				this.itemDataShow = false
				let type = e.split('|')[1];
				let value = e.split('|')[0];
				let data = {};
				console.log(type)
				if (type == 'Club') {
					data.value = value;
					this.clubShow = true
					this.isHonestyScore = true
				} else {
					this.clubShow = false
					this.isHonestyScore = false
					data.value = 'Class';
					data.classID = value
					let classstudentList = await UserClassStudentDoGetPageList({
						pageIndex: 1,
						pageSize: 9999,
						classID: value
					})
					this.MemberUserNoList = classstudentList.data.data
					this.MemberUserNoArr = classstudentList.data.data.length > 0 ? classstudentList.data.data.map((
						m) => {
							return m.UserNo
						}) : []
				}
				let res = await UserGetApplyTypeActivity(data);
				this.OldActivityTypeApplyList = res.data.newData;
				this.ActivityTypeApplyList = res.data.newData;
				this.ActivityTypeApplyList = this.ActivityTypeApplyList.map(item => {
					return {
						...item,
						//title: item.ActivityTypeName + (item.Score ? ' | ' + item.Score+(item.IsHour?'/小时':'/次') : '') + (item.ActivityLevelName ? ' | ' + item.ActivityLevelName : ''),
						title: item.ActivityTypeName + (item.Score ? ' |' + item.Score + (item.IsHour ? '/小时' :
							'/次') : '') + (item.ActivityLevelName ? ' | ' + item.ActivityLevelName : ''),
						disabled: item.IsApply ? false : true
					};
				});
				this.ActivityTypeApplyList = this.toTree(this.ActivityTypeApplyList);
				console.log(this.ActivityTypeApplyList)
				this.treeselect = false
				this.getList(type)
			},
			toTree(data) {
				let result = [];
				let map = {};
				if (!Array.isArray(data)) {
					return [];
				}
				data.forEach(item => {
					map[item.ActivityTypeID] = item;
				});
				data.forEach(item => {
					let parent = map[item.ParentID];
					if (parent) {
						(parent.children || (parent.children = [])).push(item);
					} else {
						result.push(item);
					}
				});
				return result;
			},
			PeopleNumFun(e) {
				if (e) {
					this.PeopleNumIf = e;
					this.form.setFieldsValue({
						PeopleNum: e == 1 ? '' : -1
					});
				}
			},
			ActivityTypeApplyFun(e) {
				// if (e) {
				// 	this.form.setFieldsValue({ TypeItemID: '' });
				// 	this.IsHour = this.OldActivityTypeApplyList.filter((m, i) => m.ActivityTypeID == e)[0].IsHour;
				// 	this.ActivityTypeApplyID = this.OldActivityTypeApplyList.filter((m, i) => m.ActivityTypeID == e)[0].ID;
				// 	if(this.OldActivityTypeApplyList.filter((m, i) => m.ActivityTypeID == e)[0].ItemCount>0){
				// 		this.itemDataShow = true
				// 		this.itemData = this.OldActivityTypeApplyList.filter((m, i) => m.ActivityTypeID == e)[0].itemData
				// 	}else{
				// 		this.itemDataShow = false
				// 	}
				// }
				if (e) {
					this.form.setFieldsValue({
						TypeItemID: ''
					});
					this.IsHour = this.OldActivityTypeApplyList.filter((m, i) => m.ID == e)[0].IsHour;
					//此处因为 ActivityTypeID重复导致 设置公共
					this.pubActivityTypeID = this.OldActivityTypeApplyList.filter((m, i) => m.ID == e)[0].ActivityTypeID
					console.log(this.pubActivityTypeID);
					this.ActivityTypeApplyID = this.OldActivityTypeApplyList.filter((m, i) => m.ID == e)[0].ID;
					if (this.OldActivityTypeApplyList.filter((m, i) => m.ID == e)[0].ItemCount > 0) {
						this.itemDataShow = true
						this.itemData = this.OldActivityTypeApplyList.filter((m, i) => m.ID == e)[0].itemData
					} else {
						this.itemDataShow = false
					}
				}
			},
			IsNeedApplyChange(e) {
				if (!e.target.value) {
					this.form.setFieldsValue({
						ApplyIsNeedExam: false
					});
				}
			},
			confirm(e) {
				this.handleSubmit(e);
			},
			cancel(e) {},
			closeFunction(data) {
				this.$emit('closeFun', data);
			},
			handleCancel() {
				this.previewVisible = false;
				this.previewImage = '';
			},
			async handlePreview(file) {
				this.previewImage = this.requestUrl + file.response.url;
				window.open(this.previewImage, '_blank')
				// let nameType = file.name.substr(file.name.lastIndexOf('.') + 1)
				// if(this.global.imgTypeList.findIndex(m=>{return m==nameType})<0){
				// 	this.$message.error('该文件格式不支持预览')
				// 	return false
				// }
				// this.previewImage = this.requestUrl + file.response.url;
				// this.previewVisible = true;
			},
			beforeUpload(file) {
				let that = this;
				const isSize = new Promise(function(resolve, reject) {
					let width = 141;
					let height = 54;
					let _URL = window.URL || window.webkitURL;
					let img = new Image();
					img.onload = function() {
						let valid = img.width == img.height;
						valid ? resolve() : reject();
					};
					img.src = _URL.createObjectURL(file);
				}).then(
					() => {
						return file;
					},
					() => {
						that.$message.error('请上传宽高比例为1:1的图片！');
						return Promise.reject();
					}
				);
				return isSize;
			},
			icohandleChange({
				fileList
			}, name) {
				this.icofileList = fileList;
			},
			beforeUploadfile(file, name) {
				const isLt10M = file.size / 1024 / 1024 < 10;
				if (!isLt10M) {
					this.fileList[name] = this.fileList[name].splice(this.fileList[name].length - 1, 1)
					this.$message.error('文件大小不能超过10M!');
				}
				return isLt10M;
			},
			handleChange(info, name) {
				if (!info.file.status) {
					return false
				}
				let {
					fileList
				} = info;
				const status = info.file.status;
				if (status === 'done') {
					if (info.file.response.code == 0) {
						this.$message.success(info.file.response.msg)
						this.fileList[name] = [...fileList]; //重点
					} else {
						this.$message.error(info.file.response.msg)
						this.fileList[name] = this.fileList[name].splice(this.fileList[name].length - 1, 1)
					}
				}
				this.fileList[name] = [...fileList]; //重点
			},
			dataChange(e, name, type) {
				let date = moment(e).format('YYYY-MM-DD HH:mm:ss');
				if (type == 'data') {
					if (e) {
						let time = moment(e).format('YYYY-MM-DD HH:mm:ss');
						this.dataValue = Object.assign(this.dataValue, {
							[name]: time
						});
					} else {
						this.dataValue = Object.assign(this.dataValue, {
							[name]: ''
						});
					}
				} else {
					if (e) {
						let time = moment(e).format('HH:mm:ss');
						this.dataValue = Object.assign(this.dataValue, {
							[name]: time
						});
					} else {
						this.dataValue = Object.assign(this.dataValue, {
							[name]: ''
						});
					}
				}
			},
			handleSubmit(e) {
				let that = this;
				e.preventDefault();
				this.form.validateFields(async (err, values) => {
					if (!err) {
						let data = values;
						let arr1 = [];
						data = Object.assign(data, this.formValue, this.dataValue);
						data.ActivityTypeApplyID = this.ActivityTypeApplyID;
						if (data.ValueID.split('|')[1] == 'Club') {
							data.ClubID = data.ValueID.split('|')[0];
						} else {
							data.ClassID = data.ValueID.split('|')[0];
						}
						for (let m = 0; m < this.icofileList.length; m++) {
							if (this.icofileList[m].url) {
								if (this.icofileList[m].url.indexOf(this.requestUrl) > -1) {
									this.icofileList[m].url = this.icofileList[m].url.substring(this.requestUrl
										.length);
								}
								arr1.push(this.icofileList[m].name + '|' + this.icofileList[m].url);
							} else {
								arr1.push(this.icofileList[m].response.fileName + '|' + this.icofileList[m]
									.response.url);
							}
						}
						data.Ico = arr1.join(',');
						for (let i in this.fileList) {
							let arr = [];
							for (let m = 0; m < this.fileList[i].length; m++) {
								if (this.fileList[i][m].url) {
									if (this.fileList[i][m].url.indexOf(this.requestUrl) > -1) {
										this.fileList[i][m].url = this.fileList[i][m].url.substring(this
											.requestUrl.length);
									}
									arr.push(this.fileList[i][m].name + '|' + this.fileList[i][m].url);
								} else {
									arr.push(this.fileList[i][m].response.fileName + '|' + this.fileList[i][m]
										.response.url);
								}
							}
							data[i] = arr.join(',');
						}
						for (let n in data) {
							if (data[n] == undefined) {
								data[n] = '';
							}
						}
						if (data.activityDate) {
							data.StartTime = moment(data.activityDate[0]).format('YYYY-MM-DD HH:mm:ss')
							data.EndTime = moment(data.activityDate[1]).format('YYYY-MM-DD HH:mm:ss')
						}
						if (data.ApplyTime) {
							data.ApplyStartTime = moment(data.ApplyTime[0]).format('YYYY-MM-DD HH:mm:ss')
							data.ApplyEndTime = moment(data.ApplyTime[1]).format('YYYY-MM-DD HH:mm:ss')
						}
						if (data.ClassID) {
							data.MemberUserNo = data.MemberUserNoArr.join(',')
						}
						//此处要转下pubActivityTypeID
						if (data.oldActivityTypeApplyID) {
							data.oldActivityTypeApplyID = that.pubActivityTypeID;
						}
						data.venueReserveData = this.venueList

						let res = await userAddActivity(data);
						if (res.data.code == 0) {
							this.$router.go(-1);
							that.$message.success(res.data.msg);
						} else {
							that.$message.error(res.data.msg);
						}
					}
				});
			},
			async getOtherList() {
				let res = await GetApplyFormFieldTypeList();
				this.FieldTypeList = res.data.data;
			},
			async getList(type) {
				// this.loading = true;
				let data = {};
				let res2 = await UserDoGetActivityTypeList(data);
				this.ActivityTypeList = res2.data.data;
				data.Type = type == 'Club' ? 1 : 2
				let res = await GetFormList(data);
				// this.loading = false;
				this.data = res.data.data;
				console.log(this.data)
				// this.data.forEach((item, index, arr) => {
				// 	item.obj = 'a' + index;
				// });
				for (var i = 0; i < this.data.length; i++) {
					if (this.data[i].FieldType == 5 || this.data[i].FieldType == 6) {
						this.fileList = Object.assign(this.fileList, {
							[this.data[i].ID]: []
						});
					}
				}
			}
		}
	};
</script>

<style lang="less" scoped>
	/deep/.ant-form-item {
		margin: 20px 50px;
		display: flex;
	}

	/deep/.ant-form-item-label {
		width: 180px;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		text-align: right;
	}

	/deep/.ant-form-item-control-wrapper {
		flex: 1;
	}

	/deep/.ant-calendar-picker,
	/deep/.ant-time-picker {
		width: 100% !important;
	}

	/deep/.ant-form {
		margin-top: 50px;
		padding-bottom: 50px;

	}

	/deep/.ant-checkbox-group {
		label {
			font-size: 13px;
		}

	}

	.titletip {
		padding-left: 10px;
		font-size: 12px;
		color: red;
	}

	.ant-checkbox-wrapper {
		margin-right: 10px;
		margin-left: 0px !important;
		width: 250px;
	}

	.upload-btn {
		color: #2E45AE;

		span {
			font-size: 22px;
		}
	}

	/deep/.ant-upload-select-picture-card {
		border: 1px solid #BFC5D2 !important;
	}
</style>
